#include <iostream>
#include <string>
#include "level.hpp"
#include "util.hpp"
#include <thread>

namespace my_log
{
    struct LogMsg
    {
        size_t _ctime; //日志产生的时间戳
        LogLevel::value _level;//日志等级
        std::string _file;//文件名
        size_t _line;  //行号
        std::thread::id _tid; //线程id
        std::string _logger; //日志器
        std::string _payload;//日志主体信息
        
        //构造函数
        LogMsg(
            LogLevel::value level,
            std::string file,
            size_t line,
            std::string logger,
            std::string msg)
        :_ctime(util::Date::now()),
        _level(level),
        _file(file),
        _line(line),
        _tid(std::this_thread::get_id()),
        _logger(logger),
        _payload(msg)
        {}

    };
}